using UnityEngine;
using QFramework;

namespace ProjectSurviver
{
	public partial class HP : GamePlayObject
	{
        public override Collider2D Collider2D => SelfCollider2D;

        void OnTriggerEnter2D(Collider2D other)
        {
            if(other.GetComponent<CollectableArea>())
			{
				if(Global.HP.Value == Global.MaxHP.Value)
				{

				}
				else
				{
					AudioKit.PlaySound("HP");
					Global.HP.Value++;
					this.DestroyGameObjGracefully();
				}
			}
        }
    }
}
